Skip to content

GH Issue 1867: Stop multi-row inserts from losing values or defaults when rows differ in keys or key casing - #8313

Closed
labkey-jeckels wants to merge 6 commits into
developfrom
fb_di_importrows_first_row_cols_1867
Closed

labkey-jeckels wants to merge 6 commits into
developfrom
fb_di_importrows_first_row_cols_1867

Conversation

@labkey-jeckels

@labkey-jeckels labkey-jeckels commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

This PR stops multi-row inserts and saveRows from silently storing blanks when rows in one request supply different fields or spell a field name in different case (GH Issue 1867). importRows dropped fields the first row left out; a later row spelling a key in different case blanked that field in earlier rows; and on every insert path a row omitting a column another row supplied got NULL instead of the column's database default, all while the request reported success.

Behavior change for reviewers: internal callers that relied on an omitted key meaning NULL in a mixed batch now get the column's database default, which is what a single-row insert, or a batch in which every row omits the column, already does.

Tested with new integration tests in ImportRowsTestCase, which failed before the fix, plus the collections, data iterator, statement, query update service, list, sample type, data class, lineage and plate server tests against a local PostgreSQL server. SQL Server and the Selenium tests were not run locally.

Related Pull Requests

None

Changes

  • importRows builds its columns from every row, as insertRows already does.
  • Rows that spell a key in different case keep the first spelling, so a later row no longer hides earlier rows' values.
  • On every list-of-maps insert path, a column that a row omits gets its database default, including multi-choice columns; an explicit null still stores NULL.
  • Omitted-column tracking is scoped to each import, so nested loads such as cross-type sample import don't apply another source's rows.

@labkey-jeckels

Copy link
Copy Markdown
Contributor Author

Retargeted to release26.11-SNAPSHOT: #8336

@labkey-jeckels
labkey-jeckels deleted the fb_di_importrows_first_row_cols_1867 branch November 13, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant